<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="checkbox" checked id="checkboxEl"> 同意
    <script>
        const checkboxEl = document.getElementById('checkboxEl');
        /*
            tag checked  object checked
                ''             true
                null           false
        */

        // checkboxEl.setAttribute('checked', '')
        // checkboxEl.remove('checked')
        checkboxEl.checked = false;
        console.log(checkboxEl.checked);//true
        console.log(checkboxEl.getAttribute('checked'));//null

    </script>
</body>

</html>